BrowserViewState

class BrowserViewState(browser: Browser, scope: <Error class: unknown class>, window: Window, dragAndDropEnabled: Boolean) : AutoCloseable

State of BrowserView.

This state serves as a bridge between the browser instance and the BrowserView. It reflects the internal state of the browser in a way that is understandable by both the view and Compose. Asynchronous updates from the browser are converted to a Compose-observable state and vice versa. Additionally, it allocates and manages the internal resources necessary for the view to work.

A browser instance can only be associated with one state instance at a time. An attempt to create several states for a single browser leads to a runtime exception.

This state does not provide any observable properties for configuring the BrowserView or the browser. A user should interact directly with the browser.

BrowserViewState.close should be called to release all allocated memory and resources when the state is no longer needed.

Please note, as for now, the state supports only OFF_SCREEN rendering mode. Passing a browser instance with HARDWARE_ACCELERATED mode leads to a runtime exception. See also: Rendering modes.

Since

8.0.0

Parameters

browser

The browser, whose content is to be displayed.

scope

The coroutine scope used for updating Compose observables.

window

The native AWT window in which the browser view is rendered.

dragAndDropEnabled

Whether drag-and-drop functionality is enabled.

Constructors

Link copied to clipboard
constructor(browser: Browser, scope: <Error class: unknown class>, window: Window, dragAndDropEnabled: Boolean)

Functions

Link copied to clipboard
open override fun close()

Closes the browser state and releases the occupied resources.